/**
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2024. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef OPS_COMMON_INC_OP_MC2_H
#define OPS_COMMON_INC_OP_MC2_H

#include <stddef.h>
#include <stdint.h>

namespace ops {
struct ApiParamDef {
  uint64_t x1;
  uint64_t y;
  uint64_t gatherOut;
  uint64_t context;
  uint64_t workspace;
  uint64_t tilingDataPtr;
  uint8_t tilingData[2048];
  const char soName[32] = {"libcpu_kernels.so"};
  const char kernelName[32] = {"RunAicpuRpcSrvLaunch"};
  const char opName[32] = {"HcclAicpuOp"};
  char hostInputInfo[16];
};

enum class MC2Type : uint32_t {
  K_MM_ALL_REDUCE,
  K_ALL_GATHER_MM,
  K_MM_REDUCE_SCATTER
};

enum class MC2InputIdx : size_t {
  K_X1,
  K_X2,
  K_BIAS,
  K_X3,
  K_SCALE,
  K_OFFSET,
  K_DEQUANT
};

enum class MC2OutputIdx : size_t {
  K_Y,
  K_GATHER_OUT
};

enum class AllGatherMMAttrIdx : size_t {
  K_GROUP,
  K_TRANS_X1,
  K_TRANS_X2,
  K_GATHER_IDX,
  K_COMM_TURN
};

enum class MmReduceScatterAttrIdx : size_t {
  K_GROUP,
  K_OP,
  K_TRANS_X1,
  K_TRANS_X2,
  K_COMM_TURN
};

enum class MmAllReduceAttrIdx : size_t {
  K_GROUP,
  K_OP,
  K_TRANS_X1,
  K_TRANS_X2,
  K_COMM_TURN,
  K_ANTIQUANT_GROUP_SIZE
};
}  // namespace ops

#endif  // OPS_COMMON_INC_OP_MC2_H
